package com.ggshily.swf.abc;

import java.io.DataInput;
import java.io.IOException;

public class ABCClassInfo implements IABCData
{
	public int cinit;
	public int traitCount;
	public ABCTraitInfo[] traits;
	private ABCFile file;
	
	public ABCClassInfo()
	{
		super();
	}

	public ABCClassInfo(DataInput di) throws IOException
	{
		parseInput(di);
	}

	@Override
	public void parseInput(DataInput di) throws IOException
	{
		cinit = ABCUtil.readU30(di);
		
		traitCount = ABCUtil.readU30(di);
		traits = new ABCTraitInfo[traitCount];
		for(int i = 0; i < traitCount; i++)
		{
			traits[i] = new ABCTraitInfo(di, file);
		}
	}

	@Override
	public void parseInput(DataInput di, ABCFile file) throws IOException
	{
		this.file = file;
		
		parseInput(di);
	}

}
